## Table A8: Effects of Neighborhood Race and Income on Expected Wait Times: Week Fixed Effects

## install.packages(c("tidyverse", "fixest"))
## library(tidyverse)

## SET WORKING DIRECTORY HERE
## setwd()

## Loading data
## load("dta.RData")

## Column 1
race_expected_across_wk <- feols(log_expected_time ~ factor(white_third) |
                                   city^open_week, data = dta %>% filter(city != "New York"), cluster = "geo")

## Column 2
race_expected_within_wk <- feols(log_expected_time ~ factor(white_third) |
                                   city_service^open_week, data = dta %>% filter(city != "New York"), cluster = "geo")

## Column 3
inc_expected_across_wk <- feols(log_expected_time ~ factor(inc_third) |
                                  city^ open_week, data = dta %>% filter(city != "New York"), cluster = "geo")

## Column 4
inc_expected_within_wk <- feols(log_expected_time ~ factor(inc_third) |
                                  city_service^ open_week, data = dta %>% filter(city != "New York"), cluster = "geo")


TableA8 = etable(race_expected_across_wk, race_expected_within_wk,
                 inc_expected_across_wk, inc_expected_within_wk,
                 signifCode = c("+" = 0.10, "*" = 0.05, "**" = 0.01, "***" = 0.001),
                 digits = 3, digits.stats = 3, fitstat = "r2")